//
//  RMMAginPasswordView.m
//  Romomo
//
//  Created by puman on 2016/10/19.
//  Copyright © 2016年 mazegong. All rights reserved.
//

#import "RMMAginPasswordView.h"

@implementation RMMAginPasswordView

- (instancetype)initWithFrame:(CGRect)frame{
    self.backgroundColor = kCColor;
    NSArray *array = @[@"输入接收验证码的手机号码",@"输入验证码",@"请输入新的密码",@"再次输入新密码"];
    if (self = [super initWithFrame:frame]) {
        UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWideth, 219)];
        view.backgroundColor = kWhiteColor;
        [self addSubview:view];
        
        for (int i = 0; i < 4; i++) {
            UITextField *textF = [[UITextField alloc] initWithFrame:CGRectMake(15, 55 * i, self.width  - 30, 54)];
            textF.placeholder = array[i];
            textF.font = kFont(16);
            textF.tag = 10 + i;
            textF.clearButtonMode = UITextFieldViewModeWhileEditing;
            [view addSubview:textF];
            
            if (i == 0) {
                textF.frame = CGRectMake(15, 0, kScreenWideth - 110, 54);
                _sendBut = [UIButton buttonWithType:(UIButtonTypeCustom)];
                _sendBut.frame = CGRectMake(textF.right, textF.top, 95, 54);
                _sendBut.backgroundColor = RGBA(238, 238, 238, 1);
                [_sendBut setTitleColor:COLORFROMCODE(0xD7D7D7, 1) forState:(UIControlStateNormal)];
                _sendBut.userInteractionEnabled = NO;
                _sendBut.titleLabel.font = kBFont(16);
                [_sendBut setTitle:@"收取验证码" forState:(UIControlStateNormal)];
                [view addSubview:_sendBut];

            }
            if (i < 3) {
                UILabel *lineLabel = [[UILabel alloc] initWithFrame:CGRectMake(15, textF.bottom, self.width - 15, 1)];
                lineLabel.backgroundColor = COLORFROMCODE(0xEEEEEE, 1);
                [view addSubview:lineLabel];
            }
            
        }
        
        UILabel *label =  [[UILabel alloc] initWithFrame:CGRectMake(15, view.bottom, kScreenWideth - 30, 30)];
        label.text = @"密码由6-20位字符的字母和数字组成";
        label.textColor = COLORFROMCODE(0xBFBFBF, 1);
        label.font = kFont(13);
        [self addSubview:label];
        
        _button = [UIButton buttonWithType:(UIButtonTypeCustom)];
        _button.frame = CGRectMake(kScreenWideth / 2 - 130, label.bottom + kRow, 260, 44);
        _button.backgroundColor = RGBA(238, 238, 238, 1);;
        [_button setTitleColor:COLORFROMCODE(0xD7D7D7, 1) forState:(UIControlStateNormal)];
        _button.titleLabel.font = kBFont(16);
        _button.layer.masksToBounds = YES;
        _button.layer.cornerRadius = 22;
        _button.userInteractionEnabled = NO;
        [_button setTitle:@"确定重置密码" forState:(UIControlStateNormal)];
        [self addSubview:_button];

        
    }
    return self;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
